import router from '@/router'
import {App} from 'vue'

/**
* 第一种权限验证形式
* */

/**
 * 判断是否拥有某种权限
 * @params {string} action
 * @params {boolean} include
 * */
export const hasPermission = (action: string, include = false) => {
    const currentRoute = router.currentRoute.value

    //Todo  后改为 一个指令 调用则循环接口返回所有权限  renturn boolean

}

//导出插件   挂载全局

const install = (app: App) =>{
    app.config.globalProperties.$hasPermission = hasPermission;
}
export default install
